<script setup>
import {useDictStore} from "@/store/sys/dict.js";

const valueModel = defineModel('value', {
  required: true,
  type: Boolean
})
const props = defineProps({
  code: {
    type: String,
    required: true
  },
  disabled: {
    type: Boolean,
    default: false
  },
  clearable: {
    type: Boolean,
    default: true
  }
})
const dictStore = useDictStore()
const dictItemList = computed(() => {
  return dictStore.getDictByCode(props.code)
})
</script>

<template>
<n-select :disabled="props.disabled"
          :options="dictItemList"
          v-model:value="valueModel"
          clearable/>
</template>

<style scoped>

</style>